package cn.boundtw2.jihe.Hashset;

import java.util.HashSet;

/*
要求：同名同年龄的人，视为同一个人
 */
public class Demo02HashCodecx {
    public static void main(String[] args) {
        HashSet<Stundent> set = new  HashSet<>();
        Stundent s1 = new Stundent("小明",18);
        Stundent s2 = new Stundent("小明",18);
        Stundent s3 = new Stundent("小明",19);
        System.out.println(s1.hashCode());
        System.out.println(s2.hashCode());

        System.out.println(s1==s2);
        System.out.println(s1.equals(s2));
        set.add(s1);
        set.add(s2);
        set.add(s3);
        System.out.println(set);
    }

}
